Linking an HTML Document to the Style Sheet

After creating the external style sheet (which you have learned in the previews section), you need to link an HTML document to the style sheet. The <link> element is used to link an HTML document to the style sheet.

Let’s do the following steps to link an HTML document to the external style sheet:


<!DOCYTPE html>
<html>
<head>
    <title> External Style Sheets</title>
<link rel=”stylesheet” href=”Style.css” />
</head>
<body>
    <h1> External Style Sheet Example </h1>
    <a href=”Page.html target=”_blank” ><h2>Page 1</h2></a>
    <a href=”Page2.html target=”_blank” ><h2>Page 2</h2></a>
</body>
</html> 

Save the document with the name ExtenalStylesheetLInk.html and open on browser and hover on link text.